
{% load i18n %}
{% if post.is_result or not request.user.is_authenticated %}
    <table>
    {% for answ in post.is_answer %}
        <tr>
            <td>{{ answ.value }}</td>
            <td>{{ answ.count }}</td>
            <td><span class="result" style="width: {{ answ.width }}px"> </span></td>
        </tr>
    {% endfor %}
    </table>
{% else %}
<form method='POST' action='/action/answer/{{ post.id }}/'>
{% if post.type == 3 %}
    {% for answ in post.is_answer %}
    <input type='radio' name='answ' value='{{ answ.id }}'>{{ answ.value }}<br />
    {% endfor %}
{% endif %}
{% if post.type == 4 %}
    {% for answ in post.is_answer %}
    <label><input type='checkbox' name='answ_{{ answ.id }}' value='{{ answ.id }}' />{{ answ.value }}</label><br />
    {% endfor %}
{% endif %}
<br />
<input type='submit' value='{% trans "Vote" %}' />
<input type='button' onclick="document.location='/action/refrain/{{ post.id }}/'" value='{% trans "Refrain" %}' />
</form>
{% endif %}

